<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <title>1-100的指数</title>
    <style>
        a{
            color: #c01900;
            text-decoration: none;
        }
    </style>
</head>
<body>
<a href="打印出偶数奇数和.html">打印出偶数奇数和</a>
<br/>
<br/>
<script>
    var flag=0;  //标识符
    for(var j=1; j<=100; j++){     //打印出1-100的数
        for(var i=2; i<j; i++){    //打印出除了1和本身被除，也要除以2判断
            if(j%i==0){             //判断取余为0
                flag=1;
                break;

            }else{
                flag=0;

            }
        }
        if(flag==0 && j!=1){
            document.write(j+"<br/>");
        }
    }

</script>
</body>
</html>